﻿using System;
using System.Collections.Generic;
using Model;
using DAL;
namespace BLL
{
    #region class BUserInfo
    /// <summary>
    /// Interface:UserInfo Interface
    /// Author:wxc
    /// DateTime:2021/5/20 8:26:24
    /// </summary>	
    public class BUserInfo
    {
        #region Add Method
        /// <summary>
        /// Insert an item
        /// </summary>
        /// <param name="UserInfo"></param>
        /// <returns>count of rows affected</returns>
        public int AddUserInfo(UserInfoEntity UserInfo)
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.AddUserInfo(UserInfo);
        }
        #endregion
        #region Mod Method
        /// <summary>
        /// Update an item
        /// </summary>
        /// <param name="UserInfo"></param>
        /// <returns>count of rows affected</returns>
        public int ModUserInfo(UserInfoEntity UserInfo)
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.ModUserInfo(UserInfo);
        }
        #endregion
        #region Del Method
        /// <summary>
        /// Del an item by primary key
        /// </summary>
        /// <param name="iD"></param> 
        /// <returns>count of rows affected</returns>
        public int DelUserInfo(string iD)
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.DelUserInfo(iD);
        }
        #endregion
        #region Select Method
        /// <summary>
        /// Select an item by Primarykey
        /// </summary>
        /// <param name="iD"></param>
        /// <returns>an item</returns>
        public UserInfoEntity GetUserInfo(string iD)
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.GetUserInfo(iD);
        }
        #endregion
        #region Select_All Method
        /// <summary>
        /// Select all items
        /// </summary>
        /// <returns>items</returns>
        public IList<UserInfoEntity> GetUserInfos()
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.GetUserInfos();
        }
        #endregion
        #region public common select by conditions ,we can use it by changing the GetUserInfosbyCondition(datatype condition) and sql
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<UserInfoEntity> GetUserInfosbyCondition(string sql)
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.GetUserInfosbyCondition(sql);
        }
        #endregion
        #region Select items Top n
        /// <summary>
        /// Select items by Columns
        /// </summary>
        /// <param name="columns name"></param>
        /// <returns>items</returns>
        public IList<UserInfoEntity> GetUserInfosTopN(int n)
        {
            DAL.DALUserInfo userInfo = new DALUserInfo();
            return userInfo.GetUserInfosTopN(n);
        }
        #endregion
    }
    #endregion
}
